﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="AgrupamentoVideo.aspx.cs" Inherits="AgrupamentoVideo" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
            <br />
    </p>
    
    <div class="demoheading" style="width:400px">Agrupar Vídeos</div>
     <div class="collapsePanelHeader" style="width: 400px; height: 15px">Consultar Grupos 
         de Videos</div>
      <div style="width:400">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" DataSourceID="obsVideoPorGrupo" 
                    BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" 
                    CellPadding="4" ForeColor="Black" GridLines="Vertical" 
                    DataKeyNames="nr_codigo">
                    <FooterStyle BackColor="#CCCC99" />
                    <RowStyle BackColor="#F7F7DE" />
                    <Columns>
                        <asp:BoundField DataField="nr_codigo" HeaderText="nr_codigo" 
                            SortExpression="nr_codigo" InsertVisible="False" ReadOnly="True" />
                        <asp:BoundField DataField="tx_nome" HeaderText="tx_nome" 
                            SortExpression="tx_nome" />
                        <asp:BoundField DataField="tx_localizacao" HeaderText="tx_localizacao" 
                            SortExpression="tx_localizacao" />
                        <asp:BoundField DataField="nr_genero" HeaderText="nr_genero" 
                            SortExpression="nr_genero" />
                        <asp:BoundField DataField="nr_autor" HeaderText="nr_autor" 
                            SortExpression="nr_autor" />
                        <asp:BoundField DataField="nr_formato" HeaderText="nr_formato" 
                            SortExpression="nr_formato" />
                        <asp:BoundField DataField="nr_especificacao" HeaderText="nr_especificacao" 
                            SortExpression="nr_especificacao" />
                        <asp:BoundField DataField="nr_software" HeaderText="nr_software" 
                            SortExpression="nr_software" />
                        <asp:BoundField DataField="tx_usuario" HeaderText="tx_usuario" 
                            SortExpression="tx_usuario" />
                        <asp:TemplateField HeaderText="Remover">
                            <ItemTemplate>
                                <asp:LinkButton ID="lbRemove" runat="server" onclick="lbRemove_Click">Remover</asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                    <EmptyDataTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server">Remover</asp:LinkButton>
                    </EmptyDataTemplate>
                    <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div> 

        <asp:ObjectDataSource ID="obsVideoPorGrupo" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultarPorGrupo" 
            TypeName="Negocios.AgruparVideoBLL">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlGrupo" Name="grupo" 
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>

    <br />
    <div style="width:400">
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
          <ContentTemplate>           
            <div class="collapsePanelHeader" style="width: 400px; height: 15px"></div>
                <table class="divDados" style="width: 400px">
                    <tr class="divOID">
                        <td style="width: 125px">
                            <asp:Label ID="lbGrupo" runat="server" Text="Grupo"></asp:Label>
                        </td>
                        <td>
                            &nbsp;&nbsp;
                            <asp:DropDownList ID="ddlGrupo" runat="server" DataSourceID="odsGrupo" 
                                DataTextField="Nome" DataValueField="Codigo" AppendDataBoundItems="True" 
                                AutoPostBack="True">
                                <asp:ListItem Value="0">--Selecione o Grupo--</asp:ListItem>
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="odsGrupo" runat="server" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                                TypeName="Negocios.GrupoDeVideosBLL"></asp:ObjectDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 125px">
                            Vídeo</td>
                        <td>
                            <asp:DropDownList ID="ddlVideo" runat="server" 
                                DataSourceID="odsVideo" DataTextField="tx_nome" 
                                DataValueField="nr_codigo">
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="odsVideo" runat="server" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultarSemGrupo" 
                                TypeName="Negocios.AgruparVideoBLL">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddlGrupo" Name="grupo" 
                                        PropertyName="SelectedValue" Type="Int32" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="2">
                            <asp:Button ID="btGravar" runat="server" Text="Gravar" 
                                Width="55px" onclick="BtGravar_Click" />
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:Button ID="btCancelar" runat="server" Text="Cancelar" 
                                Height="26px" onclick="btCancelar_Click" />
                        </td>
                    </tr>
                </table>
              <br />
              <asp:Label ID="lbErro" runat="server" CssClass="erro"></asp:Label>
              <br />
           </ContentTemplate>
        </asp:UpdatePanel>
    </div> 
    </asp:Content>

